package com.yunhe.policyfulfillment.policyful.repository;

import com.yunhe.policyfulfillment.policyful.domain.Banner;
import com.yunhe.policyfulfillment.policyful.model.BannerQueryCondition;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * @ClassName: BannerRepository1
 * @Description:
 * @author: GongDaCheng
 * @Date: 17:14 2021/7/21
 */
@Repository
public interface BannerRepository {

    /**
     * @Description 创建新的Banner
     * @Param Banner banner
     * @Return int
     * @Date 2021/7/22 9:13
     */
    int create(Banner banner);

    /**
     * @Description 根据id获取Banner
     * @Param Long id
     * @Return Banner
     * @Date 2021/7/22 11:12
     */
    Banner getById(@Param("id") Long id);

    /**
     * @Description 修改Banner
     * @Param Banner banner
     * @Return int
     * @Date 2021/7/22 14:14
     */
    int update(Banner banner);

    /**
     * @Description 获取所有Banner
     * @Param BannerQueryCondition bannerQueryCondition
     * @Return List<Banner>
     * @Date 2021/7/22 9:22
     */
    List<Banner> getByCondition(BannerQueryCondition bannerQueryCondition);

    /**
     * @Description 根据id置顶Banner
     * @Param Long id, String topStatus, Date updateTime
     * @Return int
     * @Date 2021/7/22 16:25
     */
    int top(@Param("id") Long id, @Param("topStatus") String topStatus,@Param("onlineStatus") String onlineStatus, @Param("updateTime") Date updateTime);

    /**
     * @Description 根据id删除Banner
     * @Param Long id
     * @Return int
     * @Date 2021/7/22 16:58
     */
    int delete(@Param("id") Long id);

    /**
     * @Description 设置Banner上下线状态
     * @Param Long id, String targetStatus, Date updateTime
     * @Return
     * @Date 2021/7/26 10:36
     */
    void setBannerStatus(@Param("id") Long id, @Param("targetStatus") String targetStatus);

    /**
     * @Description 前台获取Banner
     * @Param
     * @Return List<Banner>
     * @Date 2021/7/26 11:05
     */
    List<Banner> getBanner();

    /**
     * @Description Banner上线操作
     * @Param Long id, String targetStatus, Date date
     * @Return
     * @Date 2021/7/27 15:54
     */
    void online(@Param("id") Long id, @Param("targetStatus") String targetStatus, @Param("now") Date date);

    /**
     * @Description 定时发布Banner
     * @Param
     * @Return
     * @Date 2021/8/2 17:04
     */
    void publishTimedBanner();
}
